import request from '@/utils/request';

export async function getAfterSalesNeedInfoByPage(params: any) {
  return request('/api/sales/getAfterSalesNeedInfoByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addAfterSalesNeedInfo(params: any) {
  return request('/api/sales/addAfterSalesNeedInfo', {
    method: 'POST',
    data: params,
  });
}

export async function updateAfterSalesNeedInfo(params: any) {
  return request('/api/sales/updateAfterSalesNeedInfo', {
    method: 'POST',
    data: params,
  });
}

export async function delAfterSalesNeedInfo(params: any) {
  return request('/api/sales/delAfterSalesNeedInfo', {
    method: 'POST',
    data: params,
  });
}
/**
 * 添加售后服务
 * @param params
 * @returns
 */
export async function addAfterSalesNeedInfoEx(params: any) {
  return request('/api/sales/addAfterSalesNeedInfoEx', {
    method: 'POST',
    data: params,
  });
}

/**
 * 更新售后服务
 * @param params
 * @returns
 */

export async function updateAfterSalesNeedInfoEx(params: any) {
  return request('/api/sales/updateAfterSalesNeedInfoEx', {
    method: 'POST',
    data: params,
  });
}

/**
 * 设置保存
 * @param params
 * @returns
 */
export async function addTempAfterSalesNeedInfoEx(params: any) {
  return request('/api/sales/addTempAfterSalesNeedInfoEx', {
    method: 'POST',
    data: params,
  });
}

/**
 * 更改保存
 * @param params
 * @returns
 */
export async function updateTempAfterSalesNeedInfoEx(params: any) {
  return request('/api/sales/updateTempAfterSalesNeedInfoEx', {
    method: 'POST',
    data: params,
  });
}
/**
 * 获取授权号的详情
 * @param params
 * @returns
 */
export async function getAfterSalesNeedInfoDetailById(params: any) {
  return request('/api/sales/getAfterSalesNeedInfoDetailById', {
    method: 'POST',
    data: params,
  });
}

export async function asnUploadFile(params: any) {
  return request('/api/sales/asnUploadFile', {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

export async function asnDownload(params: any) {
  return request('/api/sales/asnDownload', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}

export async function getV90motorList(params: any) {
  return request('/api/drivepara/getV90motorList', {
    method: 'POST',
    data: params,
  });
}

export async function getS210motorList(params: any) {
  return request('/api/drivepara/getS210motorList', {
    method: 'POST',
    data: params,
  });
}

export async function afterSalesNeedList(params: any) {
  return request('/api/sales/AfterSalesNeedList', {
    method: 'POST',
    data: params,
  });
}

/**
 *
 * @param params 变更状态
 * @returns
 */

export async function updateSalesStatus(params: any) {
  return request('/api/sales/updateSalesStatus', {
    method: 'POST',
    data: params,
  });
}

export async function updateModifySuggestion(params: any) {
  return request('/api/sales/updateModifySuggestion', {
    method: 'POST',
    data: params,
  });
}

export async function afterSalesDetailExport(params: any) {
  return request('/api/sales/afterSalesDetailExport', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}

/**
 *
 * @param params 复制售后信息
 * @returns
 */
export async function copyDetailById(params: any) {
  return request('/api/sales/copyDetailById', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}
